package edu.aysf.controller;


import edu.aysf.service.ClientOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;


@RequestMapping("/pay")
@RestController
public class CalcConsumerController {

    @Autowired
    private ClientOrderService calcService;

    // 控制层调用服务层,服务层再通过feign调用order微服务中的calc服务
    // 通过feignclint调用服务提供者的calc服务
    @RequestMapping("/calc")
    public String mycalc(@RequestParam("p1") int par1, @RequestParam("p2") int par2) {
        // ，调用没有实现的echo接口再通过feignclient去调用实现了的echo方法
        return calcService.mycalc(par1,par2);
    }

}
